const fs = require('fs')
const getNumsOfProblemSolved = (filePath, type='已解决') => {
  const fileContent = fs.readFileSync(filePath, 'utf-8')
  const lines = fileContent.split('\n')
  const reg = /^(\d.)/
  let nums = 0
  for(const line of lines) {
    if(reg.test(line))
      nums++
  }
  return `${type}的题目数量为：${nums}题`
}
console.log(getNumsOfProblemSolved('../hot100/hot100复习记录.md'));